package com.web.music.model;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.*;

// TODO [done]
// You have to make this class a persistent entity
@Entity
public class MusicBand extends Artist {

	private String title;

	private String foundationDate;
	
	@ManyToMany(cascade=CascadeType.ALL)
	@JoinTable(
	    	name="BAND_PERSONS",
		joinColumns=@JoinColumn(
	  		name="ARTIST_ID",referencedColumnName="ARTIST_ID"),
		inverseJoinColumns=@JoinColumn(
			name="PERSON_ID", referencedColumnName="PERSON_ID"))
			
	private List<Person> members = new ArrayList<Person>();

	public String getTitle(){
		return title;
	}

	public String getFoundationDate(){
		return foundationDate;
	}

	public void setFoundationDate(String foundationDate){
		this.foundationDate = foundationDate;
	}

	public void setTitle(String title ){
		this.title = title;
	}

	public List<Person> getMembers() {
		return members;
	}

	public void setMembers(List<Person> members) {
		this.members = members;
	}

}
